namespace RPGLibrary.CharacterClasses
{
    public enum EntityGender {Male, Female, Unkown}
    public enum EntityType {Character, NPC, Monster, Creature}

    public sealed class Entity
    {
        #region Vital Field & Property Region

        public string EntityName { get; private set; }
        public string EntityClass { get; private set; }
        public EntityType EntityType { get; private set; }
        public EntityGender Gender { get; private set; }

        #endregion

        #region Basic Attributes & Properties Region

        private int strength;
        private int dexterity;
        private int cunning;
        private int willpower;
        private int magic;
        private int constitution;

        private int strengthModifier;
        private int dexterityModifier;
        private int cunningModifier;
        private int willpowerModifier;
        private int magicModifier;
        private int constitutionModifier;

        public int Strength
        {
            get { return strength + strengthModifier; }
            protected set { strength = value; }
        }

        public int Dexterity
        {
            get { return dexterity + dexterityModifier; }
            protected set { dexterity = value; }
        }

        public int Cunning
        {
            get { return cunning + cunningModifier; }
            protected set { cunning = value; }
        }

        public int Willpower
        {
            get { return willpower + willpowerModifier; }
            protected set { willpower = value; }
        }

        public int Magic
        {
            get { return magic + magicModifier; }
            protected set { magic = value; }
        }

        public int Constitution
        {
            get { return constitution + constitutionModifier; }
            protected set { constitution = value; }
        }

        #endregion

        #region Calculated Attributes & Properties

        public AttributePair Health { get; private set; }

        public AttributePair Stamina { get; private set; }

        public AttributePair Mana { get; private set; }

        private int attack;
        private int damage;
        private int defense;

        #endregion

        #region Level Field and Property Region

        public int Level { get; protected set; }

        public long Experience { get; protected set; }

        #endregion

        #region Constructors Region

        private Entity()
        {
            Strength = 0;
            Dexterity = 0;
            Cunning = 0;
            Willpower = 0;
            Magic = 0;
            Constitution = 0;

            Health = new AttributePair(0);
            Stamina = new AttributePair(0);
            Mana = new AttributePair(0);
        }

        public Entity(string name, EntityData entityData, EntityGender gender, EntityType entityType)
        {
            EntityName = name;
            EntityClass = entityData.EntityName;
            Gender = gender;
            EntityType = entityType;
            Strength = entityData.Strength;
            Dexterity = entityData.Dexterity;
            Cunning = entityData.Cunning;
            Willpower = entityData.Willpower;
            Magic = entityData.Magic;
            Constitution = entityData.Constitution;

            Health = new AttributePair(0);
            Stamina = new AttributePair(0);
            Mana = new AttributePair(0);
        }

        #endregion
    }
}